package com.install.core.util;

import java.sql.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class UserUtil {
	private HttpServletRequest request;
	private HttpSession session;
	private String uid;
	private String uname;
	private String password;
	private String rylx;
	private Date zcsj;
	private String sessionid;
	private JSONArray gns_list;
	private JSONArray qx_list;
	private UserUtil user;
	public UserUtil(HttpServletRequest request) throws Exception {
		this.request = request;
		this.session = request.getSession(false);
		if (session != null) {
			if(session.getAttribute("user")!=null){
				String uid=((JSONObject)session.getAttribute("user")).getString("UID");
				setUid(uid);
			}
		}
	}
	public UserUtil getUser(HttpServletRequest request){
		return user;
	}
	public HttpServletRequest getRequest() {
		return request;
	}
	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpSession getSession() {
		return session;
	}
	public void setSession(HttpSession session) {
		this.session = session;
	}
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	public String getUname() {
		return uname;
	}
	public void setUname(String uname) {
		this.uname = uname;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getRylx() {
		return rylx;
	}
	public void setRylx(String rylx) {
		this.rylx = rylx;
	}
	public Date getZcsj() {
		return zcsj;
	}
	public void setZcsj(Date zcsj) {
		this.zcsj = zcsj;
	}
	public String getSessionid() {
		return sessionid;
	}
	public void setSessionid(String sessionid) {
		this.sessionid = sessionid;
	}
	public JSONArray getGns_list() {
		return gns_list;
	}
	public void setGns_list(JSONArray gns_list) {
		this.gns_list = gns_list;
	}
	public JSONArray getQx_list() {
		return qx_list;
	}
	public void setQx_list(JSONArray qx_list) {
		this.qx_list = qx_list;
	}
}
